示例#1
0
        public void PopulateUsingKeys(string[] keys)
        {
            Id = int.Parse(keys[0]);
            var msId = int.Parse(keys[1]);

            MostSimple = Container.Instances <MostSimple>().FirstOrDefault(ms => ms.Id == msId);
        }
示例#2
0
 public virtual MostSimple[] ChoicesAConditionalChoicesReference(MostSimple aReference)
 {
     if (aReference != null)
     {
         return(Container.Instances <MostSimple>().Where(ms => ms.Id != aReference.Id).ToArray());
     }
     return(new MostSimple[] {});
 }
示例#3
0
 public virtual string Validate(MostSimple aReference, MostSimple aChoicesReference)
 {
     if (aReference != null && aReference.Id == 1 && aChoicesReference.Id == 2)
     {
         return("Cross validation failed");
     }
     return("");
 }
        public void PopulateUsingKeys(string[] keys) {
            Id = int.Parse(keys.First());

            ms1 = Container.Instances<MostSimple>().Single(x => x.Id == 1);
            dt1 = Container.Instances<WithDateTimeKey>().FirstOrDefault();
            vm1 = Container.NewViewModel<MostSimpleViewModel>();
            vm1.Id = 1;
        }
示例#5
0
        public void PopulateUsingKeys(string[] keys)
        {
            Id = int.Parse(keys.First());

            ms1    = Container.Instances <MostSimple>().Single(x => x.Id == 1);
            dt1    = Container.Instances <WithDateTimeKey>().FirstOrDefault();
            vm1    = Container.NewViewModel <MostSimpleViewModel>();
            vm1.Id = 1;
        }
        public void PopulateUsingKeys(string[] keys) {
            int rId = int.Parse(keys[0]);
            int drId = int.Parse(keys[1]);
            int hrId = int.Parse(keys[2]);
            int crId = int.Parse(keys[3]);

            Id = rId;

            AReference = Container.Instances<MostSimple>().FirstOrDefault(ms => ms.Id == rId);
            ADisabledReference = Container.Instances<MostSimple>().FirstOrDefault(vs => vs.Id == drId);
            AHiddenReference = Container.Instances<MostSimple>().FirstOrDefault(vs => vs.Id == hrId);
            AChoicesReference = Container.Instances<MostSimple>().FirstOrDefault(vs => vs.Id == crId);
            AnEagerReference = Container.Instances<MostSimple>().FirstOrDefault(ms => ms.Id == rId);
        }
示例#7
0
        public void PopulateUsingKeys(string[] keys)
        {
            var rId  = int.Parse(keys[0]);
            var drId = int.Parse(keys[1]);
            var hrId = int.Parse(keys[2]);
            var crId = int.Parse(keys[3]);

            Id = rId;

            AReference         = Container.Instances <MostSimple>().FirstOrDefault(ms => ms.Id == rId);
            ADisabledReference = Container.Instances <MostSimple>().FirstOrDefault(vs => vs.Id == drId);
            AHiddenReference   = Container.Instances <MostSimple>().FirstOrDefault(vs => vs.Id == hrId);
            AChoicesReference  = Container.Instances <MostSimple>().FirstOrDefault(vs => vs.Id == crId);
            AnEagerReference   = Container.Instances <MostSimple>().FirstOrDefault(ms => ms.Id == rId);
        }
示例#8
0
 public override MostSimple AnActionWithParametersWithChoicesWithDefaults(int parm1, int parm7, MostSimple parm2, MostSimple parm8)
 {
     return(Container.Instances <MostSimple>().First());
 }
 public virtual string Validate(MostSimple aReference, MostSimple aChoicesReference) {
     if (aReference != null && aReference.Id == 1 && aChoicesReference.Id == 2) {
         return "Cross validation failed";
     }
     return "";
 }
 public virtual MostSimple AnActionWithReferenceParametersWithAutoComplete(MostSimple parm0, MostSimple parm1) => parm0;
 public override MostSimple AnActionWithReferenceParameterWithChoices(MostSimple parm4) {
     return Container.Instances<MostSimple>().Single(x => x.Id == parm4.Id);
 }
 public virtual MostSimple AnActionWithReferenceParameterWithConditionalChoices(MostSimple parm4)
 {
     return(Container.Instances <MostSimple>().Single(x => x.Id == parm4.Id));
 }
 public virtual IList <MostSimple> Choices0AnActionWithReferenceParameterWithConditionalChoices(MostSimple parm4)
 {
     return(parm4 == null ? new List <MostSimple>() : Container.Instances <MostSimple>().Where(ms => ms.Id != parm4.Id).ToList());
 }
 public virtual ICollection <MostSimple> AnActionReturnsCollectionWithParameters(int parm1, MostSimple parm2)
 {
     Assert.AreEqual(101, parm1);
     Assert.AreEqual(Container.Instances <MostSimple>().First(), parm2);
     return(Container.Instances <MostSimple>().Where(ms => ms.Id == 1 || ms.Id == 2).ToList());
 }
 public virtual void AnActionReturnsVoidWithParameters(int parm1, MostSimple parm2)
 {
     Assert.AreEqual(101, parm1);
     Assert.AreEqual(Container.Instances <MostSimple>().First(), parm2);
 }
            private static void SeedCodeFirstDatabase(CodeFirstContext context) {
                var ms1 = new MostSimple { Id = 1 };
                var ms2 = new MostSimple { Id = 2 };
                var ms3 = new MostSimple { Id = 4 };
                context.MostSimples.Add(ms1);

                context.MostSimples.Add(ms2);

                context.MostSimples.Add(ms3);

                var wr1 = new WithReference { Id = 1, AReference = ms1, ADisabledReference = ms1, AChoicesReference = ms1, AnEagerReference = ms1, AnAutoCompleteReference = ms1 };
                var wr2 = new WithReference { Id = 2, AReference = ms1, ADisabledReference = ms1, AChoicesReference = ms1, AnEagerReference = ms1, AnAutoCompleteReference = ms1 };
                context.WithReferences.Add(wr1);

                context.WithReferences.Add(wr2);

                var wv1 = new WithValue { Id = 1, AValue = 100, ADisabledValue = 200, AStringValue = "" };
                context.WithValues.Add(wv1);

                var wv2 = new WithValue { Id = 2, AValue = 100, ADisabledValue = 200, AStringValue = "" };
                context.WithValues.Add(wv2);

                var ws1 = new WithScalars {
                    Id = 1,
                    Bool = true,
                    Byte = 1,
                    ByteArray = new[] {
                    (byte) 2
                },
                    Char = '3',
                    CharArray = new[] {
                    (char) 4
                },
                    DateTime = new DateTime(2012, 03, 27, 08, 42, 36, 0, DateTimeKind.Utc).ToUniversalTime(),
                    Decimal = 5.1M,
                    Double = 6.2,
                    Float = 7.3F,
                    Int = 8,
                    Long = 9L,
                    SByte = 10,
                    SByteArray = new[] {
                    (sbyte) 11
                },
                    Short = 12,
                    String = "13",
                    UInt = 14,
                    ULong = 15,
                    UShort = 16
                };

                context.WithScalarses.Add(ws1);

                var wa1 = new WithActionObject { Id = 1 };
                context.WithActionObjects.Add(wa1);

                var wc1 = new WithCollection { Id = 1 };
                wc1.ACollection.Add(ms1);
                wc1.ACollection.Add(ms2);
                wc1.ACollection.Add(ms3);

                wc1.ASet.Add(ms1);

                wc1.ASet.Add(ms2);

                wc1.ADisabledCollection.Add(ms1);
                wc1.ADisabledCollection.Add(ms2);
                wc1.AHiddenCollection.Add(ms1);
                wc1.AHiddenCollection.Add(ms2);
                wc1.AnEagerCollection.Add(ms1);
                wc1.AnEagerCollection.Add(ms2);
                context.WithCollections.Add(wc1);

                var we1 = new WithError { Id = 1 };
                context.WithErrors.Add(we1);

                var we2 = new WithError { Id = 2 };
                context.WithErrors.Add(we2);

                var we3 = new WithError { Id = 3 };
                context.WithErrors.Add(we3);

                var we4 = new WithError { Id = 4 };
                context.WithErrors.Add(we4);

                var wge1 = new WithGetError { Id = 1 };
                context.WithGetErrors.Add(wge1);

                var i1 = new Immutable { Id = 1 };
                context.Immutables.Add(i1);

                var vs1 = new VerySimple { Id = 1 };
                context.VerySimples.Add(vs1);

                var vs2 = new VerySimple { Id = 2 };
                context.VerySimples.Add(vs2);

                var vse1 = new VerySimpleEager { Id = 1 };
                context.VerySimpleEagers.Add(vse1);

                var dt1 = new WithDateTimeKey { Id = (new DateTime(634835232000000000L)).Date };
                context.WithDateTimeKeys.Add(dt1);

                var rdo1 = new RedirectedObject { Id = 1, ServerName = "RedirectedToServer", Oid = "RedirectedToOid" };
                context.RedirectedObjects.Add(rdo1);

                var wat1 = new WithAttachments { Id = 1 };
                context.WithAttachments.Add(wat1);

                int added = context.SaveChanges();

                wc1.ACollection.Remove(ms3);

                context.SaveChanges();
            }
 public override MostSimple AnActionReturnsObjectWithParametersAnnotatedQueryOnly(int parm1, MostSimple parm2) {
     Assert.AreEqual(101, parm1);
     Assert.AreEqual(Container.Instances<MostSimple>().First(), parm2);
     return Container.Instances<MostSimple>().First();
 }
示例#18
0
 public virtual MostSimple AnActionWithReferenceParameterWithConditionalChoices(MostSimple parm4) {
     return Container.Instances<MostSimple>().Single(x => x.Id == parm4.Id);
 }
示例#19
0
 public virtual MostSimple AnActionReturnsObjectWithParametersAnnotatedIdempotent(int parm1, MostSimple parm2) {
     Assert.AreEqual(101, parm1);
     Assert.AreEqual(Container.Instances<MostSimple>().First(), parm2);
     return Container.Instances<MostSimple>().First();
 }
示例#20
0
 public virtual void AnActionReturnsVoidWithParameters(int parm1, MostSimple parm2) {
     Assert.AreEqual(101, parm1);
     Assert.AreEqual(Container.Instances<MostSimple>().First(), parm2);
 }
示例#21
0
 public virtual int AnActionReturnsScalarWithParameters(int parm1, MostSimple parm2) {
     Assert.AreEqual(101, parm1);
     Assert.AreEqual(Container.Instances<MostSimple>().First(), parm2);
     return 555;
 }
示例#22
0
 public virtual ICollection<MostSimple> AnActionReturnsCollectionWithParameters(int parm1, MostSimple parm2) {
     Assert.AreEqual(101, parm1);
     Assert.AreEqual(Container.Instances<MostSimple>().First(), parm2);
     return Container.Instances<MostSimple>().Where(ms => ms.Id == 1 || ms.Id == 2).ToList();
 }
示例#23
0
 public virtual MostSimple AnActionWithReferenceParameterWithDefault(MostSimple parm6) {
     return Container.Instances<MostSimple>().Single(x => x.Id == parm6.Id);
 }
 public override IQueryable<MostSimple> AnActionReturnsQueryableWithParameters(int parm1, MostSimple parm2) {
     Assert.AreEqual(101, parm1);
     Assert.AreEqual(Container.Instances<MostSimple>().First(), parm2);
     return Container.Instances<MostSimple>().Where(ms => ms.Id == 1 || ms.Id == 2);
 }
 public virtual MostSimple[] ChoicesAConditionalChoicesReference(MostSimple aReference) {
     if (aReference != null) {
         return Container.Instances<MostSimple>().Where(ms => ms.Id != aReference.Id).ToArray();
     }
     return new MostSimple[] {};
 }
示例#26
0
 public virtual IList<MostSimple> Choices0AnActionWithReferenceParameterWithConditionalChoices(MostSimple parm4) {
     return parm4 == null ? new List<MostSimple>() : Container.Instances<MostSimple>().Where(ms => ms.Id != parm4.Id).ToList();
 }
示例#27
0
        private static void SeedCodeFirstDatabase(CodeFirstContext context)
        {
            var ms1 = new MostSimple {
                Id = 1
            };
            var ms2 = new MostSimple {
                Id = 2
            };
            var ms3 = new MostSimple {
                Id = 4
            };

            context.MostSimples.Add(ms1);

            context.MostSimples.Add(ms2);

            context.MostSimples.Add(ms3);

            var wr1 = new WithReference {
                Id = 1, AReference = ms1, ADisabledReference = ms1, AChoicesReference = ms1, AnEagerReference = ms1, AnAutoCompleteReference = ms1
            };
            var wr2 = new WithReference {
                Id = 2, AReference = ms1, ADisabledReference = ms1, AChoicesReference = ms1, AnEagerReference = ms1, AnAutoCompleteReference = ms1
            };

            context.WithReferences.Add(wr1);

            context.WithReferences.Add(wr2);

            var wv1 = new WithValue {
                Id = 1, AValue = 100, ADisabledValue = 200, AStringValue = ""
            };

            context.WithValues.Add(wv1);

            var wv2 = new WithValue {
                Id = 2, AValue = 100, ADisabledValue = 200, AStringValue = ""
            };

            context.WithValues.Add(wv2);

            var ws1 = new WithScalars {
                Id        = 1,
                Bool      = true,
                Byte      = 1,
                ByteArray = new[] {
                    (byte)2
                },
                Char      = '3',
                CharArray = new[] {
                    (char)4
                },
                DateTime   = new DateTime(2012, 03, 27, 08, 42, 36, 0, DateTimeKind.Utc).ToUniversalTime(),
                Decimal    = 5.1M,
                Double     = 6.2,
                Float      = 7.3F,
                Int        = 8,
                Long       = 9L,
                SByte      = 10,
                SByteArray = new[] {
                    (sbyte)11
                },
                Short  = 12,
                String = "13",
                UInt   = 14,
                ULong  = 15,
                UShort = 16
            };

            context.WithScalarses.Add(ws1);

            var wa1 = new WithActionObject {
                Id = 1
            };

            context.WithActionObjects.Add(wa1);

            var wc1 = new WithCollection {
                Id = 1
            };

            wc1.ACollection.Add(ms1);
            wc1.ACollection.Add(ms2);
            wc1.ACollection.Add(ms3);
            wc1.ACollectionViewModels.Add(new MostSimpleViewModel {
                Id = 1
            });
            wc1.ACollectionViewModels.Add(new MostSimpleViewModel {
                Id = 2
            });
            wc1.ASet.Add(ms1);

            wc1.ASet.Add(ms2);

            wc1.ADisabledCollection.Add(ms1);
            wc1.ADisabledCollection.Add(ms2);
            wc1.AHiddenCollection.Add(ms1);
            wc1.AHiddenCollection.Add(ms2);
            wc1.AnEagerCollection.Add(ms1);
            wc1.AnEagerCollection.Add(ms2);
            context.WithCollections.Add(wc1);

            var we1 = new WithError {
                Id = 1
            };

            context.WithErrors.Add(we1);

            var we2 = new WithError {
                Id = 2
            };

            context.WithErrors.Add(we2);

            var we3 = new WithError {
                Id = 3
            };

            context.WithErrors.Add(we3);

            var we4 = new WithError {
                Id = 4
            };

            context.WithErrors.Add(we4);

            var wge1 = new WithGetError {
                Id = 1
            };

            context.WithGetErrors.Add(wge1);

            var i1 = new Immutable {
                Id = 1
            };

            context.Immutables.Add(i1);

            var vs1 = new VerySimple {
                Id = 1
            };

            context.VerySimples.Add(vs1);

            var vs2 = new VerySimple {
                Id = 2
            };

            context.VerySimples.Add(vs2);

            var vse1 = new VerySimpleEager {
                Id = 1
            };

            context.VerySimpleEagers.Add(vse1);

            var dt1 = new WithDateTimeKey {
                Id = (new DateTime(634835232000000000L)).Date
            };

            context.WithDateTimeKeys.Add(dt1);

            var rdo1 = new RedirectedObject {
                Id = 1, ServerName = "RedirectedToServer", Oid = "RedirectedToOid"
            };

            context.RedirectedObjects.Add(rdo1);

            var wat1 = new WithAttachments {
                Id = 1
            };

            context.WithAttachments.Add(wat1);

            int added = context.SaveChanges();

            wc1.ACollection.Remove(ms3);

            context.SaveChanges();
        }
示例#28
0
 public virtual MostSimple AnActionWithParametersWithChoicesWithDefaults(int parm1, int parm7, MostSimple parm2, MostSimple parm8) {
     return Container.Instances<MostSimple>().First();
 }
 public virtual int AnActionReturnsScalarWithParameters(int parm1, MostSimple parm2)
 {
     Assert.AreEqual(101, parm1);
     Assert.AreEqual(Container.Instances <MostSimple>().First(), parm2);
     return(555);
 }
示例#30
0
 public virtual MostSimple AnActionWithReferenceParametersWithAutoComplete(MostSimple parm0, MostSimple parm1) {
     return parm0;
 }
 public virtual MostSimple AnActionReturnsObjectWithParametersAnnotatedIdempotent(int parm1, MostSimple parm2)
 {
     Assert.AreEqual(101, parm1);
     Assert.AreEqual(Container.Instances <MostSimple>().First(), parm2);
     return(Container.Instances <MostSimple>().First());
 }
示例#32
0
 public override IQueryable <MostSimple> AnActionReturnsQueryableWithParameters(int parm1, MostSimple parm2)
 {
     Assert.AreEqual(101, parm1);
     Assert.AreEqual(Container.Instances <MostSimple>().First(), parm2);
     return(Container.Instances <MostSimple>().Where(ms => ms.Id == 1 || ms.Id == 2));
 }
 public virtual MostSimple AnActionWithReferenceParameterWithDefault(MostSimple parm6)
 {
     return(Container.Instances <MostSimple>().Single(x => x.Id == parm6.Id));
 }
示例#34
0
 public override MostSimple AnActionReturnsObjectWithParametersAnnotatedQueryOnly(int parm1, MostSimple parm2)
 {
     Assert.AreEqual(101, parm1);
     Assert.AreEqual(Container.Instances <MostSimple>().First(), parm2);
     return(Container.Instances <MostSimple>().First());
 }
 public virtual MostSimple AnActionWithParametersWithChoicesWithDefaults(int parm1, int parm7, MostSimple parm2, MostSimple parm8) => Container.Instances <MostSimple>().First();
示例#36
0
 public override MostSimple AnActionWithReferenceParameterWithChoices(MostSimple parm4)
 {
     return(Container.Instances <MostSimple>().Single(x => x.Id == parm4.Id));
 }
 public virtual MostSimple AnActionWithFindMenuParameter([FindMenu] MostSimple parm2)
 {
     return(Container.Instances <MostSimple>().Single(x => x.Id == 1));
 }
 public void PopulateUsingKeys(string[] keys) {
     Id = int.Parse(keys[0]);
     int msId = int.Parse(keys[1]);
     MostSimple = Container.Instances<MostSimple>().FirstOrDefault(ms => ms.Id == msId);
 }