--- title: Locode - Database-First --- Using [AutoQuery's AutoGen](/autoquery/autogen) enables the quickest way to modernize an existing database by generating Data Models & AutoQuery CRUD APIs from RDBMS table schemas. From Locode's point of view, the result is indistinguishable to [Code-First](/locode/code-first) where instead of developers defining Data Models & API Contracts in code they're dynamically generated by AutoGen at runtime, on Startup. The difference is how APIs & Types are customized, with Code-First Types able to naturally access the [Declarative Dev Model](/locode/declarative) using C# Attributes, Database-First Models instead need to dynamically add attributes at runtime using AutoGen's Type & Service filters. Regardless of how they're created & customized, each have access to Locode's instant modern UI around AutoQuery services. To get started quickly watch this video for a step-by-step walkthrough into creating a **Database-first Locode App**: