예제 #1
0
        public static void SetScaleMeasuresAnnotation(this EdmModel model, IEdmProperty property, byte scale)
        {
            if (model == null) throw new ArgumentNullException("model");
            if (property == null) throw new ArgumentNullException("property");

            var target = property;
            var term = ScaleTerm;
            var expression = new EdmIntegerConstant(scale);
            var annotation = new EdmAnnotation(target, term, expression);
            annotation.SetSerializationLocation(model, property.ToSerializationLocation());
            model.AddVocabularyAnnotation(annotation);
        }
예제 #2
0
        public static void SetISOCurrencyMeasuresAnnotation(this EdmModel model, IEdmProperty property, string isoCurrency)
        {
            if (model == null) throw new ArgumentNullException("model");
            if (property == null) throw new ArgumentNullException("property");

            var target = property;
            var term = ISOCurrencyTerm;
            var expression = new EdmStringConstant(isoCurrency);
            var annotation = new EdmAnnotation(target, term, expression);
            annotation.SetSerializationLocation(model, property.ToSerializationLocation());
            model.AddVocabularyAnnotation(annotation);
        }
예제 #3
0
        public static void SetISOCurrencyMeasuresAnnotation(this EdmModel model, IEdmProperty property, string isoCurrency)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }
            if (property == null)
            {
                throw new ArgumentNullException("property");
            }

            var target     = property;
            var term       = ISOCurrencyTerm;
            var expression = new EdmStringConstant(isoCurrency);
            var annotation = new EdmAnnotation(target, term, expression);

            annotation.SetSerializationLocation(model, property.ToSerializationLocation());
            model.AddVocabularyAnnotation(annotation);
        }
예제 #4
0
        public static void SetScaleMeasuresAnnotation(this EdmModel model, IEdmProperty property, byte scale)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }
            if (property == null)
            {
                throw new ArgumentNullException("property");
            }

            var target     = property;
            var term       = ScaleTerm;
            var expression = new EdmIntegerConstant(scale);
            var annotation = new EdmAnnotation(target, term, expression);

            annotation.SetSerializationLocation(model, property.ToSerializationLocation());
            model.AddVocabularyAnnotation(annotation);
        }
예제 #5
0
        public static void SetPermissionsCoreAnnotation(this EdmModel model, IEdmProperty property, CorePermission value)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }
            if (property == null)
            {
                throw new ArgumentNullException("property");
            }

            var target     = property;
            var term       = PermissionsTerm;
            var name       = new EdmEnumTypeReference(PermissionType, false).ToStringLiteral((long)value);
            var expression = new EdmEnumMemberReferenceExpression(PermissionType.Members.Single(m => m.Name == name));
            var annotation = new EdmAnnotation(target, term, expression);

            annotation.SetSerializationLocation(model, property.ToSerializationLocation());
            model.AddVocabularyAnnotation(annotation);
        }