public static void AddDescription <T>(this IHaveDescriptions <T> entity, string text) where T : class, IDescription, new() { T newDescription = new T(); newDescription.Text = text; entity.Desriptions.Add(newDescription); }
public static void EditDescription <T>(this IHaveDescriptions <T> entity, T original, string text) where T : class, IDescription, new() { T newDescription = new T(); newDescription.Text = text; entity.Desriptions.Remove(original); entity.Desriptions.Add(newDescription); }