public Result UpdateAuthors(List <Author> lst)
        {
            try
            {
                foreach (var item in lst)
                {
                    item.UpdateTime = DateTime.Now;
                    item.Name       = item.Name.ToUpper();
                    item.Surname    = item.Surname.ToUpper();
                }

                var result = this.ValidateUpdate(lst);

                if (result.Status != ResultStatus.Success)
                {
                    return(result);
                }

                _iAuthorDal.Update(lst);

                return(lst.FirstOrDefault().Result = new Result
                {
                    Status = ResultStatus.Success,
                    Description = "Kaydedildi",
                    Data = lst
                });
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Example #2
0
 public IResult Update(Author author)
 {
     _authorDal.Update(author);
     return(new SuccessResult(AuthorMessages.AuthorAdded));
 }
Example #3
0
 public void Update(Author author)
 {
     _authorDal.Update(author);
 }
Example #4
0
 public string Update(Author author)
 {
     _authorDal.Update(author);
     return("Yazar başarıyla güncellendi");
 }
 public Author Update(Author author)
 {
     return(_authorDal.Update(author));
 }