Пример #1
0
        public void AddConfiguration(Configuration configuration)
        {
            configuration.DateAdded = DateTime.UtcNow;

            using (IDocumentSession session = HawramanApplication.RavenDbDocumentStore.OpenSession())
            {
                session.Store(configuration);
                session.SaveChanges();
            }
        }
Пример #2
0
        public Configuration GetConfiguration(int id)
        {
            Configuration config = new Configuration();

            using (IDocumentSession session = HawramanApplication.RavenDbDocumentStore.OpenSession())
            {
                config = session.Query<Configuration>().Where(c => c.Id == id).SingleOrDefault();
            }

            return config;
        }
Пример #3
0
        public void EditConfiguration(Configuration configuration)
        {
            using (IDocumentSession session = HawramanApplication.RavenDbDocumentStore.OpenSession())
            {
                Configuration config = session.Load<Configuration>
                    (string.Format("configurations/{0}", configuration.Id.ToString()));
                config.Config = configuration.Config;

                session.SaveChanges();
            }
        }