public void Update <M>(List <M> modelsWithNewValues) where M : class, IModel, new()
        {
            api.Update(modelsWithNewValues, this.crudModels.UpdateModel);

            foreach (var model in modelsWithNewValues)
            {
                var eventForUpdatedModel = new CqrsEvent <M>(ECqrsEventType.UpdateEvent, model);
                CqrsEventHandler <M> .AddEvent(eventForUpdatedModel);
            }
        }
        public void Delete(List <M> modelsToDelete)
        {
            api.Delete(modelsToDelete, crudModels.DeleteModel);

            foreach (var deletedModel in modelsToDelete)
            {
                var eventForDeletedModel = new CqrsEvent <M>(ECqrsEventType.DeleteEvent, deletedModel);
                CqrsEventHandler <M> .AddEvent(eventForDeletedModel);
            }
        }
        public void Create(List <M> newModels)
        {
            api.Create(newModels, crudModels.CreateModel);

            foreach (var newModel in newModels)
            {
                var eventForNewModel = new CqrsEvent <M>(ECqrsEventType.CreateEvent, newModel);
                CqrsEventHandler <M> .AddEvent(eventForNewModel);
            }
        }