public async Task <ActionResult <Fresher> > PostFresher(Fresher fresher)
        {
            _context.Fresher.Add(fresher);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetFresher", new { id = fresher.FresherId }, fresher));
        }
        public async Task <IActionResult> PutFresher(string id, Fresher fresher)
        {
            if (id != fresher.FresherId)
            {
                return(BadRequest());
            }

            _context.Entry(fresher).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!FresherExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemplo n.º 3
0
        public void Frescher_CreateTwo_ShouldBeOk()
        {
            var f1 = new Fresher();
            var f2 = new Fresher();

            Assert.IsNotNull(f1);
            Assert.IsNotNull(f2);
        }
Exemplo n.º 4
0
 public void StartCallCenter()
 {
     var fresher1 = new Fresher {
         Name = "Anna", Status = PersonStatus.CanTakeCall
     };
     var fresher2 = new Fresher {
         Name = "Peter", Status = PersonStatus.Occupied
     };
     var techlead1 = new TechLead {
         Name = "Sara", Status = PersonStatus.CanTakeCall
     };
     var pm1 = new ProductManager {
         Name = "Maria", Status = PersonStatus.CanTakeCall
     };
     var techlead2 = new TechLead {
         Name = "Magnus", Status = PersonStatus.CanTakeCall
     };                                                                                    // Should result in exception
 }