What type of project template is used to store entity classes and repository?

MSCollege3000 180 Reputation points
2023-12-14T04:26:53.81+00:00

If a solution includes separate projects - 1 for entity classes, 2 - infrastructure, and the 3rd project is MAUI app, what types of projects should first two layers be?

Is it correct to make database layer as another MAUI project in the solution, remove every file and folder from it except these:

sl

And in the project's file erase everything except this:

<Project Sdk="Microsoft.NET.Sdk">
	<PropertyGroup>
		<TargetFrameworks>net6.0</TargetFrameworks>
		<RootNamespace>Models</RootNamespace>
		<ImplicitUsings>enable</ImplicitUsings>
		<Nullable>enable</Nullable>
	</PropertyGroup>
</Project>
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,916 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 48,261 Reputation points Microsoft Vendor
    2023-12-15T02:20:28.5866667+00:00

    Hello,

    For the three-layer structure of database layer, infrastructure layer and app layer, most of the applicable scenarios are to provide API interfaces and persistence through cloud services.

    In the MAUI program, you could refer to the following documents to import the local database.

    If you have a server, you can encapsulate the database with persistence as a web API server and make an Http request via MAUI to fetch the data in it.

    Is it correct to make database layer as another MAUI project in the solution

    A database is a database project, for example, Sqllite is embedded in the program as a file as a local database. SQL Server or MySQL can be used as a remote database in the server.

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.