示例#1
0
        /// <summary>
        /// Sets the content type identifier.
        /// </summary>
        /// <param name="id">The content type model identifier.</param>
        /// <param name="contentTypeId">The content type identifier.</param>
        public void SetContentTypeId(Guid id, int contentTypeId)
        {
            var contentType = new ContentType {
                Id = id, ContentTypeId = contentTypeId
            };

            _databaseWrapper.CreateTable <ContentType>();
            _databaseWrapper.Insert(contentType, id);
        }
示例#2
0
        /// <summary>
        /// Sets the definition identifier.
        /// </summary>
        /// <param name="id">The definition model identifier.</param>
        /// <param name="definitionId">The definition identifier.</param>
        public void SetDefinitionId(Guid id, int definitionId)
        {
            var dataType = new DataType {
                Id = id, DefinitionId = definitionId
            };

            _databaseWrapper.CreateTable <DataType>();
            _databaseWrapper.Insert(dataType, id);
        }
        private void InitializeDatabase(IDatabaseWrapper dbWrapper)
        {
            string subjectName = WindowsIdentity.GetCurrent().Name;
            string port        = HostAddress.Split(':')[2].Split('/')[0];
            string subjName    = WindowsIdentity.GetCurrent().Name.Replace('\\', '_').Replace('-', '_');

            ServiceName = subjName + port;

            sqliteWrapper = dbWrapper;
            sqliteWrapper.CreateDatabase("Connections" + port);
            sqliteWrapper.ConnectToDatabase();
            sqliteWrapper.CreateTable(ServiceName);
        }