Exemple #1
0
        public int CreateSemister(SemisterEntity SemisterEntity)
        {
            var sem2 = _autoMapper.Map <SemisterEntity, Semister>(SemisterEntity);

            _Iunitofwork.SemisterRepository.Insert(sem2);
            _Iunitofwork.Save();
            return(0);
        }
        public IActionResult Put(int id, [FromBody] SemisterEntity SemisterEntity)
        {
            if (id == SemisterEntity.Id)
            {
                _SemisterServices.UpdateSemister(id, SemisterEntity);

                return(Ok(SemisterEntity));
            }
            return(NotFound());
        }
Exemple #3
0
        public bool UpdateSemister(int ID, SemisterEntity semisterentity)
        {
            var Toupdate = _autoMapper.Map <SemisterEntity, Semister>(semisterentity);
            var success  = false;

            if (Toupdate != null && Toupdate.Id > 0)
            {
                _Iunitofwork.SemisterRepository.Update(Toupdate);
                _Iunitofwork.Save();
                success = true;
            }
            return(success);
        }
 public IActionResult Post([FromBody] SemisterEntity SemisterEntity)
 {
     _SemisterServices.CreateSemister(SemisterEntity);
     return(Ok(SemisterEntity));
 }