예제 #1
0
        public SerializationIgnorerExpression <TRootViewModel> ForMember <TViewModel>(
            Expression <Func <TViewModel, object> > destinationMember)
        {
            var member = destinationMember.Body as MemberExpression;

            SerializationIgnorer.IgnoreProperty <TRootViewModel>(typeof(TViewModel), member.Member.Name);
            return(new SerializationIgnorerExpression <TRootViewModel>());
        }
예제 #2
0
        public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
        {
            var response = actionExecutedContext.Response; //.Content as ObjectContent;

            if (response != null)
            {
                SerializationIgnorer.ModifyViewModel(response.Content);
            }
        }
        public static void Configure()
        {
            SerializationIgnorer.Create <ApplicationUserViewModel>()
            .ForMember <QualificationLevelViewModel>(e => e.ApplicationUsers)
            .ForMember <RoomViewModel>(e => e.ApplicationUsers);

            SerializationIgnorer.Create <ApplicationUserViewPagedModel>()
            .ForMember <QualificationLevelViewModel>(e => e.ApplicationUsers)
            .ForMember <RoomViewModel>(e => e.ApplicationUsers);

            SerializationIgnorer.Create <OfficeViewModel>()
            .ForMember <FloorViewModel>(e => e.Office);

            SerializationIgnorer.Create <FloorViewModel>()
            .ForMember <OfficeViewModel>(e => e.Floors)
            .ForMember <RoomViewModel>(e => e.Floor);

            SerializationIgnorer.Create <QualificationLevelViewModel>()
            .ForMember <ApplicationUserViewModel>(e => e.QualificationLevel);

            SerializationIgnorer.Create <RoomViewModel>()
            .ForMember <FloorViewModel>(e => e.Rooms)
            .ForMember <ApplicationUserViewModel>(e => e.Room);
        }