Exemple #1
0
    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);
    }
Exemple #2
0
    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);
    }