public static void AddOkMessage(this string message, AccountingDbContext context) { context.Messages.Add(new Message() { Type = MessageType.Ok, Id = message }); }
public static void AddErrorMessage(this string message, AccountingDbContext context, List <ValidationResult> results = null) { context.Messages.Add(new Message() { Type = MessageType.Error, Id = message }); if (results != null) { results.Add(new ValidationResult(message)); } }