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.

LuGroupsDataAccess.cs 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using Luticate2.Auth.DataAccess.Models;
  2. using Luticate2.Auth.Dbo.Groups;
  3. using Luticate2.Utils.DataAccess;
  4. namespace Luticate2.Auth.DataAccess
  5. {
  6. public class LuGroupsDataAccess : LuEfCrudDataAccess<lu_groups, LuGroupsAddDbo, LuGroupsDbo, LuGroupsAddDbo, LuDatabaseContext>
  7. {
  8. public LuGroupsDataAccess(LuDatabaseContext db)
  9. : base(db, db.lu_groups)
  10. {
  11. }
  12. public string Get()
  13. {
  14. return "groups";
  15. }
  16. protected override lu_groups GetModelFromTCreate(LuGroupsAddDbo obj)
  17. {
  18. return new lu_groups
  19. {
  20. name = obj.Name
  21. };
  22. }
  23. protected override lu_groups GetModelFromTUpdate(LuGroupsAddDbo obj)
  24. {
  25. return GetModelFromTCreate(obj);
  26. }
  27. protected override LuGroupsDbo GetDboFromModel(lu_groups model)
  28. {
  29. return new LuGroupsDbo
  30. {
  31. Id = model.id.ToString(),
  32. Name = model.name
  33. };
  34. }
  35. }
  36. }