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 { public LuUtilsFkPkGuidDataAccess(IServiceProvider serviceProvider) : base(serviceProvider) { } protected override DbSet GetTable(LuUtilsDbContext db) { return db.fk_pk_guids; } protected override IQueryable GetGetQueryable(LuUtilsDbContext db, IQueryable 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(); } } }