dotnet ef migrations add LengthsMigration --context AdminAuditLogDbContext --project ..\Kelsey.IdentityServer.Admin.EntityFramework.SqlServer\Kelsey.IdentityServer.Admin.EntityFramework.SqlServer.csproj
This file contains 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
select CreatedDate , * from dbo_Customers | |
where | |
(DATEDIFF(day, CAST(CreatedDate as date), GETDATE())) > 180 | |
-- day is for the intervals, could be minute, hour. | |
-- using 180 days (6 months) for testing. | |
-- The CreatedDate is of type DateTime (datetime2). | |
-- using Table dbo_Customers |
This file contains 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
SELECT TOP 1 SubjectAdditionalData, * FROM AuditLog | |
WHERE | |
len(SubjectAdditionalData) = | |
(SELECT max(len(SubjectAdditionalData)) FROM AuditLog); |
If you have a local clone, you can update it by running the following commands.
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a
$('.yourElement').contents()[0].data = 'New Data';
Add-Migration CreateIdentitySchema -Context ApplicationDbContext -OutputDir ".\Data\Migrations\"
Remove-Migration -Context ApplicationDbContext
Boot up powershell in admin mode and **_navigate to the root of your repos.
I am serious about this, make sure you do this in a sub folder. Mine is F:\source\repos
Then run this command:
Get-ChildItem .\ -include bin,obj -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
select count(*) as [Count], Avg(Amount) as [Average], Sum(Amount)/2 as [Sum divided by 2] from dbo_OrderLineItems where OrderId in
(
select Id from dbo_Orders where CustomerId in
(
'GUIDGUID-GUID-GUID-GUID-GUIDGUID',
'GUIDGUID-GUID-GUID-GUID-GUIDGUID',
'GUIDGUID-GUID-GUID-GUID-GUIDGUID'
) and (Cast(CreatedDate as date) between '01 June 2022' and '31 July 2022')
)
OlderNewer