public override void CopyFrom(IdModelBase obj, bool copyId)
        {
            var telephone = obj as Telephone;

            if (telephone == null)
            {
                return;
            }
            Number  = telephone.Number;
            Owner   = telephone.Owner;
            OwnerId = telephone.OwnerId;
            base.CopyFrom(obj, copyId);
        }
示例#2
0
        public override void CopyFrom(IdModelBase obj, bool copyId)
        {
            var email = obj as Email;

            if (email == null)
            {
                return;
            }
            Address = email.Address;
            Owner   = email.Owner;
            OwnerId = email.OwnerId;
            base.CopyFrom(obj, copyId);
        }
示例#3
0
        public override void CopyFrom(IdModelBase obj, bool copyId)
        {
            var owner = obj as Owner;

            if (owner == null)
            {
                return;
            }
            Apartments = owner.Apartments;
            Emails     = owner.Emails;
            Name       = owner.Name;
            Telephones = owner.Telephones;
            base.CopyFrom(obj, copyId);
        }
        public override void CopyFrom(IdModelBase obj, bool copyId)
        {
            var building = obj as Building;

            if (building == null)
            {
                return;
            }
            Apartments = building.Apartments;
            District   = building.District;
            Name       = building.Name;
            Number     = building.Number;
            Province   = building.Province;
            Street     = building.Street;
            Ward       = building.Ward;
            base.CopyFrom(obj, copyId);
        }
示例#5
0
        public override void CopyFrom(IdModelBase obj, bool copyId)
        {
            var apartment = obj as Apartment;

            if (apartment == null)
            {
                return;
            }
            AvailableFrom = apartment.AvailableFrom;
            BedRoomCount  = apartment.BedRoomCount;
            Building      = apartment.Building;
            BuildingId    = apartment.BuildingId;
            Code          = apartment.Code;
            Commission    = apartment.Commission;
            HasFurniture  = apartment.HasFurniture;
            Note          = apartment.Note;
            Owner         = apartment.Owner;
            OwnerId       = apartment.OwnerId;
            Price         = apartment.Price;
            base.CopyFrom(obj, copyId);
        }
示例#6
0
        public static dynamic ExpandSingleItem(this IUrlHelper urlHelper, string methodName, IdModelBase item)
        {
            IEnumerable <LinkItem>       links            = GetLinks(urlHelper, methodName, item.Id);
            IDictionary <string, object> resourceToReturn = item.ToDynamic() as IDictionary <string, object>;

            resourceToReturn.Add("links", links);

            return(resourceToReturn);
        }
示例#7
0
        public static dynamic ExpandSingleItem(this IUrlHelper urlHelper, string methodName, IdModelBase item)
        {
            var links    = GetLinks(urlHelper, methodName, item.Id);
            var resource = item.ToDynamic() as IDictionary <string, object>;

            resource.Add("links", links);

            return(resource);
        }