|
@@ -12,33 +12,19 @@ namespace Luticate2.Utils.Business
|
12
|
12
|
_luWebSocketNotificationsBusiness = luWebSocketNotificationsBusiness;
|
13
|
13
|
}
|
14
|
14
|
|
15
|
|
- public string GetEntityType(Type crudType)
|
16
|
|
- {
|
17
|
|
- var name = crudType.Name;
|
18
|
|
- if (name.EndsWith("Business"))
|
19
|
|
- {
|
20
|
|
- name = name.Remove(name.Length - 8);
|
21
|
|
- }
|
22
|
|
- if (name.Length > 0 && char.IsUpper(name[0]))
|
23
|
|
- {
|
24
|
|
- name = char.ToLower(name[0]) + name.Remove(0, 1);
|
25
|
|
- }
|
26
|
|
- return name;
|
27
|
|
- }
|
28
|
|
-
|
29
|
15
|
public void NotifyCreate(Type crudType, object newEntity)
|
30
|
16
|
{
|
31
|
|
- _luWebSocketNotificationsBusiness.NotifyCrudCreate(GetEntityType(crudType), newEntity);
|
|
17
|
+ _luWebSocketNotificationsBusiness.NotifyCrudCreate(crudType.GetCrudEntityType(), newEntity);
|
32
|
18
|
}
|
33
|
19
|
|
34
|
20
|
public void NotifyUpdate(Type crudType, object oldEntity, object newEntity)
|
35
|
21
|
{
|
36
|
|
- _luWebSocketNotificationsBusiness.NotifyCrudUpdate(GetEntityType(crudType), oldEntity, newEntity);
|
|
22
|
+ _luWebSocketNotificationsBusiness.NotifyCrudUpdate(crudType.GetCrudEntityType(), oldEntity, newEntity);
|
37
|
23
|
}
|
38
|
24
|
|
39
|
25
|
public void NotifyDelete(Type crudType, object oldEntity)
|
40
|
26
|
{
|
41
|
|
- _luWebSocketNotificationsBusiness.NotifyCrudDelete(GetEntityType(crudType), oldEntity);
|
|
27
|
+ _luWebSocketNotificationsBusiness.NotifyCrudDelete(crudType.GetCrudEntityType(), oldEntity);
|
42
|
28
|
}
|
43
|
29
|
}
|
44
|
30
|
}
|