Esempio n. 1
0
 private void ErrosHandle <TEntity>(DataResultsDto <TEntity> results)
 {
     foreach (var error in _notifications.GetValues())
     {
         results.Add(error.Value);
     }
 }
Esempio n. 2
0
        public DataResultsDto <TEntity> ResponseResult <TEntity>(TEntity entity)
        {
            var results = new DataResultsDto <TEntity>()
            {
                Entity = entity
            };

            if (!_notifications.HasNotifications())
            {
                return(results);
            }

            ErrosHandle(results);

            return(results);
        }
Esempio n. 3
0
        public DataResultsDto <TEntity> ResponseResult <TEntity>(IEnumerable <TEntity> data)
        {
            var results = new DataResultsDto <TEntity>()
            {
                Data = data
            };

            results.Count = data != null?data.Count() : 0;

            if (!_notifications.HasNotifications())
            {
                return(results);
            }

            ErrosHandle(results);

            return(results);
        }