当前位置: 首页>>代码示例>>C#>>正文


C# Ticket.Save方法代码示例

本文整理汇总了C#中Ticket.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Ticket.Save方法的具体用法?C# Ticket.Save怎么用?C# Ticket.Save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ticket的用法示例。


在下文中一共展示了Ticket.Save方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InitializeActiveRecord

        private void InitializeActiveRecord()
        {
            ActiveRecordStarter.CreateSchema();

            //Add some data for the demo
            using(new SessionScope())
            {
                var andy = new User{ Name = "Andy Pike" };
                andy.Save();

                var amber = new User{ Name = "Amber Pike" };
                amber.Save();

                var george = new User { Name = "George Good" };
                george.Save();

                var demo = new Project{ Name = "Demo Project" };
                demo.Save();

                var secret = new Project { Name = "My top secret project" };
                secret.Save();

                var ie6Bug = new Ticket
                                 {
                                     Type = TicketType.Bug,
                                     Summary = "The boxes do not line up in IE6 ;o)",
                                     Body = "If you go to any page on the site it look terrible in IE6.",
                                     AssignedTo = amber,
                                     CreatedAt = DateTime.Now,
                                     Project = demo
                                 };
                ie6Bug.Save();

                var addProfilePictures = new Ticket
                                            {
                                                Type = TicketType.FeatureRequest,
                                                Summary = "Show a user's photo when they login",
                                                Body = "Show a user's Gravatar based on their email. See documentation on gravatar.com.",
                                                AssignedTo = andy,
                                                CreatedAt = DateTime.Now,
                                                Project = demo
                                            };
                addProfilePictures.Save();

                var filters = new Ticket
                                {
                                    Type = TicketType.Bug,
                                    Summary = "User filters not working",
                                    Body = "When filtering the list of users, none of the options seem to change the list.",
                                    AssignedTo = andy,
                                    CreatedAt = DateTime.Now,
                                    Project = secret
                                };
                filters.Save();
            }
        }
开发者ID:andypike,项目名称:Talks,代码行数:56,代码来源:Global.asax.cs


注:本文中的Ticket.Save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。