This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.Extensions.Configuration; | |
| [Binding] | |
| public class Setup | |
| { | |
| [BeforeFeature] | |
| public static void BeforeFeature(FeatureContext featureContext) | |
| { | |
| // Read settings from testSettings.Development file | |
| var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Development" ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $server = "127.0.0.1" | |
| $database = "TomatoFarm123" | |
| $username ="use12356" | |
| $password = "pAssWord!" | |
| $connectionString = "Server=$server;Database=$database;User Id=$username;Password=$password;" | |
| $webConfig = "C:\Code\tomatofarm\Api\Api\Web.Config" | |
| $xml = New-Object xml | |
| $xml.PreserveWhitespace = $true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ApiContext : IApiContext | |
| { | |
| private readonly string _baseUri; | |
| public ApiContext(string baseUri) | |
| { | |
| _baseUri = baseUri; | |
| } | |
| public Uri GetPageUri(PaginationFilter filter, string route) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var tasks = new List<Task<ResponseDto>>(); | |
| foreach (var survey in filteredSurveys) | |
| { | |
| var task = Task.Run(() => GetResponses(survey)); | |
| tasks.Add(task); | |
| } | |
| Task.WaitAll(tasks.ToArray()); | |
| return tasks.Select(x => x.Result).ToList(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Route("api/[controller]")] | |
| [ApiController] | |
| public class EmployeeController : ControllerBase | |
| { | |
| private readonly HrContext _hrContext; | |
| public EmployeeController(HrContext hrContext) | |
| { | |
| _hrContext = hrContext; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var connectionString = "Server=(local)\\sqlexpress;Initial Catalog=AcmeDatabase;Persist Security Info=False; integrated security=True"; | |
| services.AddDbContext<AcmeContext>(o => o.UseSqlServer(connectionString)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class AcmeContext : DbContext | |
| { | |
| public AcmeContext(DbContextOptions<AcmeContext> options) | |
| : base(options) | |
| { | |
| } | |
| public DbSet<Employee> Employees { get; set; } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| Console.WriteLine("Running Select Many Sample..."); | |
| IEnumerable<Person> people = new List<Person>() | |
| { | |
| new Person() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const downloadFile = (filename, text) => { | |
| var element = document.createElement('a'); | |
| element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); | |
| element.setAttribute('download', filename); | |
| element.style.display = 'none'; | |
| document.body.appendChild(element); | |
| element.click(); | |
| document.body.removeChild(element); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Build Task - Pack the Migration | |
| # | |
| $dataDir = "$(System.DefaultWorkingDirectory)\Acme.Data\bin\Release" | |
| $migrationExePath = "$(System.DefaultWorkingDirectory)\packages\EntityFramework.6.2.0\tools\migrate.exe" | |
| $stagingDirectory = "$(Build.ArtifactStagingDirectory)\Data" | |
| Write-Output "MigrationPath: $migrationExePath" | |
| Write-Output "DataDir: $dataDir" |
NewerOlder