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.

LuUtilsPkGuidDataAccess.cs 1.0KB

1234567891011121314151617181920212223242526272829303132333435
  1. using Luticate2.Utils.DataAccess;
  2. using Test.Utils.DataAccess.Models;
  3. using Test.Utils.Dbo.PkGuid;
  4. namespace Test.Utils.DataAccess
  5. {
  6. public class LuUtilsPkGuidDataAccess : LuEfCrudDataAccess<pk_guid, PkGuidAddDbo, PkGuidDbo, PkGuidAddDbo, LuUtilsDbContext>
  7. {
  8. public LuUtilsPkGuidDataAccess(LuUtilsDbContext db) : base(db, db.pk_guid)
  9. {
  10. }
  11. protected override pk_guid GetModelFromTCreate(PkGuidAddDbo obj)
  12. {
  13. return GetModelFromTUpdate(obj, new pk_guid());
  14. }
  15. protected override void EditModelFromTUpdate(PkGuidAddDbo obj, pk_guid model)
  16. {
  17. model.some_int = obj.SomeInt;
  18. model.some_text = obj.SomeText;
  19. }
  20. protected override PkGuidDbo GetDboFromModel(pk_guid model)
  21. {
  22. return new PkGuidDbo
  23. {
  24. CreatedAt = model.created_at,
  25. Id = model.id.ToString(),
  26. SomeInt = model.some_int,
  27. SomeText = model.some_text
  28. };
  29. }
  30. }
  31. }