public void AddEntities_MultiRow_OK() { IEnumerable <Clientes> entities = new List <Clientes>() { new Clientes { CIF = "000000009", Direccion = "to remove", Nombre = "555555", Mail = "*****@*****.**", FechaEntrada = DateTime.Today, FormaPago = "60 días" }, new Clientes { CIF = "000000009", Direccion = "to remove", Nombre = "555555", Mail = "*****@*****.**", FechaEntrada = DateTime.Today, FormaPago = "60 días" } }; IEnumerable <Clientes> result = instance.AddEntities(entities); Assert.Equal(result.Count(), entities.Count()); Assert.NotEqual(result.First().IdCliente, default(int)); Assert.NotEqual(result.ElementAt(1).IdCliente, default(int)); }
/// <summary> /// Add a sequence of items in DB, returns the new sequence of items from DB (EF) /// </summary> /// <param name="entities">Sequence of entities</param> /// <returns>Items Added with Identity values updated</returns> public IEnumerable <TEntity> AddEntities(IEnumerable <TEntity> entities) { var result = efRepository.AddEntities(entities); return(result); }