2025-02-13 17:57:43 +05:00
|
|
|
|
using DD.Persistence.Database.Entity;
|
2025-02-17 08:44:48 +05:00
|
|
|
|
using DD.Persistence.Models.Requests;
|
2025-02-13 17:57:43 +05:00
|
|
|
|
using DD.Persistence.Repositories;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.Extensions.Caching.Memory;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using UuidExtensions;
|
|
|
|
|
|
|
|
|
|
namespace DD.Persistence.Database.Repositories;
|
|
|
|
|
public class ChangeLogCommitRepository : IChangeLogCommitRepository
|
|
|
|
|
{
|
|
|
|
|
private DbContext db;
|
|
|
|
|
|
|
|
|
|
public ChangeLogCommitRepository(DbContext db)
|
|
|
|
|
{
|
|
|
|
|
this.db = db;
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-17 08:44:48 +05:00
|
|
|
|
public async Task<Guid> Add(ChangeLogCommitDto commitDto, CancellationToken token)
|
|
|
|
|
{
|
2025-02-13 17:57:43 +05:00
|
|
|
|
|
|
|
|
|
var commit = new ChangeLogCommit()
|
|
|
|
|
{
|
|
|
|
|
Id = Uuid7.Guid(),
|
2025-02-17 08:44:48 +05:00
|
|
|
|
IdAuthor = commitDto.IdAuthor,
|
|
|
|
|
Comment = commitDto.Comment,
|
|
|
|
|
Creation = commitDto.Creation,
|
2025-02-13 17:57:43 +05:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
db.Add(commit);
|
|
|
|
|
|
|
|
|
|
await db.SaveChangesAsync();
|
|
|
|
|
return commit.Id;
|
|
|
|
|
}
|
|
|
|
|
}
|