コード例 #1
0
        // GET api/<controller>
        public IEnumerable <ProjectModel> Get()
        {
            var jsonModel = new List <ProjectModel>()
            {
                new ProjectModel()
                {
                    Id          = 1,
                    Name        = "Portal",
                    Duration    = 7,
                    Completion  = new DateTime(2013, 12, 1),
                    Description = "Cloud based administration tool built to allow simple and secure maintenance of complex financial data by both internal users and external partners.",
                    Tags        = TagDictionary.Where(o => (new List <TagEnum>()
                    {
                        TagEnum.KnockoutJS, TagEnum.MVC, TagEnum.WCF, TagEnum.SQL, TagEnum.AzureSQL
                    }).Contains(o.Key)).ToDictionary(o => o.Key, o => o.Value)
                },
                new ProjectModel()
                {
                    Id          = 2,
                    Name        = "Polar",
                    Duration    = 5,
                    Completion  = new DateTime(2014, 1, 1),
                    Description = "Cloud based multi-tenant application allowing clients to access their managed financial plans as well as add their own un-managed plans.",
                    Tags        = TagDictionary.Where(o => (new List <TagEnum>()
                    {
                        TagEnum.MVC, TagEnum.MSSQL, TagEnum.IIS
                    }).Contains(o.Key)).ToDictionary(o => o.Key, o => o.Value)
                },
                new ProjectModel()
                {
                    Id          = 2,
                    Name        = "Polar",
                    Duration    = 5,
                    Completion  = new DateTime(2014, 1, 1),
                    Description = "Cloud based multi-tenant application allowing clients to access their managed financial plans as well as add their own un-managed plans.",
                    Tags        = TagDictionary.Where(o => (new List <TagEnum>()
                    {
                        TagEnum.MVC, TagEnum.MSSQL, TagEnum.IIS
                    }).Contains(o.Key)).ToDictionary(o => o.Key, o => o.Value)
                },
                new ProjectModel()
                {
                    Id          = 2,
                    Name        = "Polar",
                    Duration    = 5,
                    Completion  = new DateTime(2014, 1, 1),
                    Description = "Cloud based multi-tenant application allowing clients to access their managed financial plans as well as add their own un-managed plans.",
                    Tags        = TagDictionary.Where(o => (new List <TagEnum>()
                    {
                        TagEnum.MVC, TagEnum.MSSQL, TagEnum.IIS
                    }).Contains(o.Key)).ToDictionary(o => o.Key, o => o.Value)
                }
            };

            return(jsonModel);
        }
コード例 #2
0
        public static int?GetTagLength(byte tag)
        {
            foreach (KeyValuePair <int, IEnumerable <byte> > pair in TagDictionary.Where(pair =>
                                                                                         pair.Value.Any(x => tag == x)))
            {
                return(pair.Key);
            }

            return(null);
        }