using BotSharp.Abstraction.Repositories; using BotSharp.Abstraction.Repositories.Models; using BotSharp.Abstraction.Repositories.Records; using Microsoft.EntityFrameworkCore.Infrastructure; namespace BotSharp.Core.Repository; public class BotSharpDbContext : Database, IBotSharpRepository { public IQueryable User => Table(); public IQueryable Agent => Table(); public IQueryable UserAgent => Table(); public IQueryable Conversation => Table(); public IQueryable RoutingItem => throw new NotImplementedException(); public IQueryable RoutingProfile => throw new NotImplementedException(); public void UpdateAgent(AgentRecord agent) { throw new NotImplementedException(); } public void CreateUser(UserRecord user) { throw new NotImplementedException(); } public UserRecord GetUserByEmail(string email) { throw new NotImplementedException(); } public int Transaction(Action action) { DatabaseFacade database = base.GetMaster(typeof(TTableInterface)).Database; int num = 0; if (database.CurrentTransaction == null) { using (Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction dbContextTransaction = database.BeginTransaction()) { try { action(); num = base.SaveChanges(); dbContextTransaction.Commit(); return num; } catch (Exception ex) { dbContextTransaction.Rollback(); if (ex.Message.Contains("See the inner exception for details")) { throw ex.InnerException; } throw ex; } } } try { action(); return base.SaveChanges(); } catch (Exception ex2) { if (database.CurrentTransaction != null) { database.CurrentTransaction.Rollback(); } if (ex2.Message.Contains("See the inner exception for details")) { throw ex2.InnerException; } throw ex2; } } public void DeleteRoutingItems() { throw new NotImplementedException(); } public void DeleteRoutingProfiles() { throw new NotImplementedException(); } public List CreateRoutingItems(List routingItems) { throw new NotImplementedException(); } public List CreateRoutingProfiles(List profiles) { throw new NotImplementedException(); } public List GetAgentResponses(string agentId) { throw new NotImplementedException(); } public AgentRecord GetAgent(string agentId) { throw new NotImplementedException(); } public void CreateNewConversation(ConversationRecord conversation) { throw new NotImplementedException(); } public string GetConversationDialog(string conversationId) { throw new NotImplementedException(); } public void UpdateConversationDialog(string conversationId, string dialogs) { throw new NotImplementedException(); } public List GetConversationState(string conversationId) { throw new NotImplementedException(); } public void UpdateConversationState(string conversationId, List state) { throw new NotImplementedException(); } public ConversationRecord GetConversation(string conversationId) { throw new NotImplementedException(); } public List GetConversations(string userId) { throw new NotImplementedException(); } }