Example #1
0
        private async Task Add(FileInfoEntity fileInfoEntity)
        {
            await this.ExecuteInContextAsync(async dbContext =>
            {
                dbContext.Add(fileInfoEntity);

                await dbContext.SaveChangesAsync();
            });
        }
Example #2
0
        public static EntityType ToEntityType(this AppType appType)
        {
            var entityType = new EntityType()
            {
                FileIdentity = appType.FileIdentity.Value,
                FilePath     = appType.FilePath.Value,
                FileFormat   = appType.FileFormat,
            };

            return(entityType);
        }
Example #3
0
        public static AppType ToAppType(this EntityType entityType)
        {
            var appType = new AppType()
            {
                FileIdentity = new FileIdentity(entityType.FileIdentity),
                FilePath     = new FilePath(entityType.FilePath),
                FileFormat   = entityType.FileFormat,
            };

            return(appType);
        }
Example #4
0
        public async Task <FileIdentity> Add(FilePath filePath, FileFormat fileFormat)
        {
            var guid = Guid.NewGuid();

            var fileIdentity = new FileIdentity(guid);

            var entity = new FileInfoEntity()
            {
                FileIdentity = fileIdentity.Value,
                FilePath     = filePath.Value,
                FileFormat   = fileFormat,
            };

            await this.Add(entity);

            return(fileIdentity);
        }