Ejemplo n.º 1
0
        public async Task <Project> AddProject(ProjectDTO project)
        {
            var proj = new Project()
            {
                Name        = project.Name,
                Description = project.Description
            };
            await context.AddAsync(proj);

            await context.SaveChangesAsync();

            return(proj);
        }
Ejemplo n.º 2
0
        public async Task <Profile> EditProfile(ProfileDTO profile, int profileId)
        {
            var _profile = await context.Profiles.FirstOrDefaultAsync(o => o.Id == profileId);

            _profile.Adress      = profile.Adress;
            _profile.BirthDate   = profile.BirthDate;
            _profile.FathersName = profile.FathersName;
            _profile.Gender      = profile.Gender;
            _profile.Name        = profile.Name;
            _profile.Surname     = profile.Surname;
            _profile.PhoneNumber = profile.PhoneNumber;
            await context.SaveChangesAsync();

            return(_profile);
        }
Ejemplo n.º 3
0
        public async Task <ToDoTask> AddTask(ToDoTaskDTO task)
        {
            var _task = new ToDoTask()
            {
                Title         = task.Title,
                Description   = task.Description,
                StartDate     = DateTime.Now,
                isCompleted   = false,
                EstimatedDate = task.EstimatedDate
            };
            await context.AddAsync(_task);

            await context.SaveChangesAsync();

            return(_task);
        }
Ejemplo n.º 4
0
        public async Task <Marks> AddMark(MarkDTO marks)
        {
            var mark = new Marks()
            {
                Name        = marks.Name,
                Description = marks.Description,
                Image       = marks.Image
            };
            await context.Markses.AddAsync(mark);

            await context.SaveChangesAsync();

            return(mark);
        }