GitHub Codespaces templates provides you quick and easy development setup you need, Check this video for more information.
Regards,
Samitha
GitHub Codespaces templates provides you quick and easy development setup you need, Check this video for more information.
Regards,
Samitha
With the changes to Program.cs in .Net Core 7, we can still access confirmation options as below
appsettings.json
Program.cs{
"Settings": {
"AccessTokenKey": "abcd123",
"AccessTokenExpirySeconds": 3600,
"RefreshTokenExpiryDays": 30
}
}
var builder = WebApplication.CreateBuilder();
ConfigurationManager config= builder.Configuration; // allows access to the config
IWebHostEnvironment environment = builder.Environment;// access the environment
var key = builder .Configuration["Settings:AccessTokenKey"];
Cheers,
Samitha
When working with .Net 7 WEB API projects you might have encountered following error when connection to SQL Server.
A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.).
This occurs due to a breaking change in SQL driver.
This issue can be resolved by adding TrustServerCertificate=True attribute to your connection string as shown below.
"ConnectionStrings": {
"DefaultConnection": "Server=SQL_SERVER_NAME;Database=DATABASE_NAME;Integrated Security=True;TrustServerCertificate=True;",
}
Cheers,
Samithaa
As a backend developer, I found OneOf package is pretty useful in returning several types from a one method.
With OneOf you van return,
from the service.
You can download OneOf package here and read more about usage here.
Regards,
Samitha
As a backend developer, I have primarily used this package to return the objects, validation errors, and try..catch errors from the service.
If you are interested in remote working opportunities try following websites.
Regards,
Samitha
There was a table storing employee pay details as varchar. There was a requirement to sort the data ascending/descending on the UI. But it would not sort as data type is varchar.
To resolve the issue I have implemented a workaround as follows and it worked well.
1. Clone the data table
2. change the desired column's data type
3. change the desired column's data type
4. Bind datatable to the data sourceSample code is as followsPublic Function GetDataTable(ByVal sortByExprerssion As String) As DataTable Dim dtBulkSalary As DataTable dtBulkSalary = bulkSalary.SelectByFilter() 'workaround to sort varchar If (Not IsNothing(dtBulkSalary)) Then Dim dtBulkSalaryCloned As DataTable = dtBulkSalary.Clone() dtBulkSalaryCloned.Columns("Yearly_Salary").DataType = Type.[GetType]("System.Decimal") dtBulkSalaryCloned.Columns("Normal_Rate").DataType = Type.[GetType]("System.Decimal") For Each bulkSalaryRow As DataRow In dtBulkSalary.Rows Dim drBulkSalaryCloned As DataRow = dtBulkSalaryCloned.NewRow drBulkSalaryCloned("BulkSalaryChange_ID") = bulkSalaryRow("BulkSalaryChange_ID") drBulkSalaryCloned("Yearly_Salary") = If(IsDBNull(bulkSalaryRow("Yearly_Salary")), 0.0D, CDec(DecryptValue(bulkSalaryRow("Yearly_Salary")))) drBulkSalaryCloned("Normal_Rate") = If(IsDBNull(bulkSalaryRow("Normal_Rate")), 0.00, CDec(DecryptValue(bulkSalaryRow("Normal_Rate")))) dtBulkSalaryCloned.AcceptChanges() Dim dvBulkSalary As DataView = dtBulkSalaryCloned.DefaultView dvBulkSalary.Sort = sortByExprerssion dtBulkSalary = dvBulkSalary.ToTable() End If Return dtBulkSalary End FunctionPlease note that data decrypted function is not listed here.Cheers,Samitha