using Ropin.Inspection.Model.Entities; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Ropin.Inspection.Repository { public class TmtnSpotDevOpsContentRepository : RepositoryBase, ITmtnSpotDevOpsContentRepository { public TmtnSpotDevOpsContentRepository(InspectionDbContext DbContext) : base(DbContext) { } public Task DeleteBySpotIdAsync(string spotId) { MySqlConnector.MySqlParameter[] parameters = new[] { new MySqlConnector.MySqlParameter("Id", spotId) }; int result = EntityFrameworkCoreExtensions.ExecuteSqlNoQuery(DbContext.Database, "DELETE from TMTN_SpotDevOpsContent WHERE C_SpotCode = @Id", parameters); return Task.FromResult(result); } public IEnumerable GetBySpotCodeAsync(string id) { MySqlConnector.MySqlParameter[] parameters = new[] { new MySqlConnector.MySqlParameter("Id", id)}; var contentlist = EntityFrameworkCoreExtensions.SqlQuery(DbContext.Database, "select A.* from TMTN_DevOpsContent A, TISP_Spot B ,TMTN_SpotDevOpsContent C WHERE A.C_ID = C.C_DevOpsContentCode AND B.C_Code = C.C_SpotCode AND C.C_SpotCode = @Id", parameters); return contentlist; } } }