Ejemplo n.º 1
0
        public long?AddDeviceOwner(ViewDeviceOwner v, Guid userId)
        {
            Trace.Assert(_db != null);
            Trace.Assert(v != null);
            ObjectResult <long?> result = _db.AddDeviceOwner(
                v.FirstName, v.LastName, v.Company, v.Apartament, v.Building, v.Street, v.City,
                v.State, v.Country, v.ZipCode, v.EMail, v.Phone, v.Cell, userId);

            Trace.Assert(result != null);
            IEnumerator <long?> resultList = result.GetEnumerator();

            Trace.Assert(resultList != null);
            resultList.MoveNext();
            long?id = resultList.Current;

            resultList.Dispose(); //  for transaction to be able to complete
            return(id);
        }