| | | 1 | | using Microsoft.EntityFrameworkCore; |
| | | 2 | | using Microsoft.Extensions.Logging; |
| | | 3 | | using System; |
| | | 4 | | using System.Collections.Generic; |
| | | 5 | | using System.Linq; |
| | | 6 | | using System.Text.Json; |
| | | 7 | | using System.Threading.Tasks; |
| | | 8 | | using WinSolutions.Sveta.Server.Domain; |
| | | 9 | | using WinSolutions.Sveta.Server.Data.DataModel.Contexts; |
| | | 10 | | using WinSolutions.Sveta.Server.Data.DataModel.Entities; |
| | | 11 | | using WinSolutions.Sveta.Server.Data.DataModel.Kinds; |
| | | 12 | | using WinSolutions.Sveta.Server.Services.Interfaces; |
| | | 13 | | using WinSolutions.Sveta.Common; |
| | | 14 | | using SVETA.Api.Helpers; |
| | | 15 | | |
| | | 16 | | |
| | | 17 | | namespace WinSolutions.Sveta.Server.Services.Implements |
| | | 18 | | { |
| | | 19 | | public class SmsHistoryService : SvetaServiceBase, ISmsHistoryService |
| | | 20 | | { |
| | | 21 | | private readonly SvetaDbContext _db; |
| | | 22 | | private readonly ILogger<SmsHistoryService> _logger; |
| | | 23 | | public SmsHistoryService(SvetaDbContext db, ILogger<SmsHistoryService> logger, IAuthenticationService authentica |
| | 83 | 24 | | : base(authenticationService) |
| | 83 | 25 | | { |
| | 83 | 26 | | _db = db; |
| | 83 | 27 | | _logger = logger; |
| | 83 | 28 | | } |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | ///создает запись |
| | | 32 | | /// </summary> |
| | | 33 | | /// <param name="data">объект SmsHistory</param> |
| | | 34 | | /// <returns></returns> |
| | | 35 | | public async Task Create(SmsHistory data) |
| | 0 | 36 | | { |
| | 0 | 37 | | await _db.SmsHistory.AddAsync(data); |
| | 0 | 38 | | await _db.SaveChangesAsync(CurrentUserId); |
| | 0 | 39 | | } |
| | | 40 | | } |
| | | 41 | | } |