Exemplo n.º 1
0
        public static EnrollmentDto AdaptTo(this Enrollment p8, EnrollmentDto p9)
        {
            if (p8 == null)
            {
                return(null);
            }
            MapContextScope scope = new MapContextScope();

            try
            {
                object cache;

                Dictionary <ReferenceTuple, object> references = scope.Context.References;
                ReferenceTuple key = new ReferenceTuple(p8, typeof(EnrollmentDto));

                if (references.TryGetValue(key, out cache))
                {
                    return((EnrollmentDto)cache);
                }
                EnrollmentDto result = new EnrollmentDto(p8.EnrollmentId, p8.CourseId, p8.StudentId, p8.Grade, funcMain7(p8.Course), funcMain10(p8.Student));
                references[key] = (object)result;
                return(result);
            }
            finally
            {
                scope.Dispose();
            }
        }
Exemplo n.º 2
0
        private static EnrollmentDto funcMain12(Enrollment p15)
        {
            if (p15 == null)
            {
                return(null);
            }
            MapContextScope scope = new MapContextScope();

            try
            {
                object cache;

                Dictionary <ReferenceTuple, object> references = scope.Context.References;
                ReferenceTuple key = new ReferenceTuple(p15, typeof(EnrollmentDto));

                if (references.TryGetValue(key, out cache))
                {
                    return((EnrollmentDto)cache);
                }
                EnrollmentDto result = new EnrollmentDto(p15.EnrollmentId, p15.CourseId, p15.StudentId, p15.Grade, null, null);
                references[key] = (object)result;
                return(result);
            }
            finally
            {
                scope.Dispose();
            }
        }