You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LuUtilsFkPkGuidDataAccess.cs 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using System.Linq;
  3. using Luticate2.Utils.DataAccess;
  4. using Luticate2.Utils.Utils;
  5. using Microsoft.EntityFrameworkCore;
  6. using TestUtils.DataAccess.Models;
  7. using TestUtils.Dbo.FkPkGuid;
  8. namespace TestUtils.DataAccess
  9. {
  10. public class LuUtilsFkPkGuidDataAccess : LuEfCrudDataAccess<fk_pk_guids, FkPkGuidAddDbo, FkPkGuidDbo, FkPkGuidAddDbo, LuUtilsDbContext, string>
  11. {
  12. public LuUtilsFkPkGuidDataAccess(IServiceProvider serviceProvider) : base(serviceProvider)
  13. {
  14. }
  15. protected override DbSet<fk_pk_guids> GetTable(LuUtilsDbContext db)
  16. {
  17. return db.fk_pk_guids;
  18. }
  19. protected override IQueryable<fk_pk_guids> GetGetQueryable(LuUtilsDbContext db, IQueryable<fk_pk_guids> table)
  20. {
  21. return table.Include(guids => guids.fk_pk_guid);
  22. }
  23. protected override fk_pk_guids GetModelFromTCreate(FkPkGuidAddDbo obj)
  24. {
  25. return GetModelFromTUpdate(obj, new fk_pk_guids());
  26. }
  27. protected override void EditModelFromTUpdate(FkPkGuidAddDbo obj, fk_pk_guids model)
  28. {
  29. model.name = obj.Name;
  30. model.pk_guid_id = obj.PkGuidId.ToGuid();
  31. }
  32. protected override FkPkGuidDbo GetDboFromModel(fk_pk_guids model)
  33. {
  34. return model.ToDbo();
  35. }
  36. }
  37. }