public MarksDto Add_Mark(MarksDto marks)
        {
            MapperDto_Class.ConfigAutoMapper();

            if (this.IsValidmark(marks))
            {
                var NewMARK = repository.Insert(Mapper.Map <Marks>(marks));

                return(Mapper.Map <MarksDto>(NewMARK));
            }
            else
            {
                throw new ArgumentNullException("Provided information is not valid.");
            }
        }
        private bool IsValidmark(MarksDto marks)
        {
            if (marks == null)
            {
                throw new ArgumentNullException("Null reference ");
            }

            if (string.IsNullOrEmpty(marks.Maths.ToString()))
            {
                throw new ArgumentNullException("Maths:validation error");
            }
            if (string.IsNullOrEmpty(marks.Science.ToString()))
            {
                throw new ArgumentNullException("Science:validation error");
            }

            if (string.IsNullOrEmpty(marks.Language.ToString()))
            {
                throw new ArgumentNullException("Language:validation error");
            }

            return(true);
        }
 public ReturnData <List <MarkModule> > AddMarks(int studentId, MarksDto marksDto)
 {
     return(null);
 }
        public ReturnData <List <MarkModule> > AddMarks([FromRoute] int id, [FromBody] MarksDto marksDto)
        {
            CollegeServices cs = new CollegeServices();

            return(cs.AddMarks(id, marksDto));
        }