12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System;
- using System.Linq;
- using Luticate2.Utils.DataAccess;
- using Luticate2.Utils.Utils;
- using Microsoft.EntityFrameworkCore;
- using TestUtils.DataAccess.Models;
- using TestUtils.Dbo.FkPkGuid;
-
- namespace TestUtils.DataAccess
- {
- public class LuUtilsFkPkGuidDataAccess : LuEfCrudDataAccess<fk_pk_guids, FkPkGuidAddDbo, FkPkGuidDbo, FkPkGuidAddDbo, LuUtilsDbContext, string>
- {
- public LuUtilsFkPkGuidDataAccess(IServiceProvider serviceProvider) : base(serviceProvider)
- {
- }
-
- protected override DbSet<fk_pk_guids> GetTable(LuUtilsDbContext db)
- {
- return db.fk_pk_guids;
- }
-
- protected override IQueryable<fk_pk_guids> GetGetQueryable(LuUtilsDbContext db, DbSet<fk_pk_guids> table)
- {
- return table.Include(guids => guids.fk_pk_guid);
- }
-
- protected override fk_pk_guids GetModelFromTCreate(FkPkGuidAddDbo obj)
- {
- return GetModelFromTUpdate(obj, new fk_pk_guids());
- }
-
- protected override void EditModelFromTUpdate(FkPkGuidAddDbo obj, fk_pk_guids model)
- {
- model.name = obj.Name;
- model.pk_guid_id = obj.PkGuidId.ToGuid();
- }
-
- protected override FkPkGuidDbo GetDboFromModel(fk_pk_guids model)
- {
- return model.ToDbo();
- }
- }
- }
|