Exemplo n.º 1
0
        public Project CreateProject(string name, string description)
        {
            var table = GetTable(ProjectsTable);
            var entity = new ProjectEntity { Id = Guid.NewGuid(), Name = name, Description = description };
            var operation = TableOperation.Insert(entity);
            table.Execute(operation);

            return entity.ToDomain();
        }
Exemplo n.º 2
0
        public Project GetProjectById(Guid id)
        {
            var entity = new ProjectEntity { Id = id };
            var table = GetTable(ProjectsTable);

            var result = table
                        .CreateQuery<ProjectEntity>()
                        .Where(x => x.PartitionKey == "" && x.RowKey == entity.RowKey)
                        .SingleOrDefault();

            return result?.ToDomain();
        }