fixes the compile and timestamps to db
This commit is contained in:
parent
abfc68a809
commit
bed9c8a272
15 changed files with 36 additions and 36 deletions
|
|
@ -17,7 +17,7 @@ namespace Yavsc.Server.Helpers
|
|||
string WRPostMultipart(string url, Dictionary<string, object> parameters, string authorizationHeader = null)
|
||||
{
|
||||
|
||||
string boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x");
|
||||
string boundary = "---------------------------" + DateTime.UtcNow.Ticks.ToString("x");
|
||||
byte[] boundaryBytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n");
|
||||
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||
|
|
@ -99,7 +99,7 @@ namespace Yavsc.Server.Helpers
|
|||
{
|
||||
var client = new HttpClient();
|
||||
var formData = new MultipartFormDataContent();
|
||||
|
||||
|
||||
if (access_token != null)
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", access_token);
|
||||
foreach (var formFile in formFiles)
|
||||
|
|
@ -108,7 +108,7 @@ namespace Yavsc.Server.Helpers
|
|||
if (formFile.ContentType!=null)
|
||||
fileStreamContent.Headers.ContentType = new MediaTypeHeaderValue(formFile.ContentType);
|
||||
else fileStreamContent.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
|
||||
|
||||
|
||||
// fileStreamContent.Headers.ContentDisposition = formFile.ContentDisposition!=null? new ContentDispositionHeaderValue(
|
||||
// formFile.ContentDisposition) : new ContentDispositionHeaderValue("form-data; name=\"file\"; filename=\"" + formFile.Name + "\"");
|
||||
fileStreamContent.Headers.Add("Content-Disposition", formFile.ContentDisposition);
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ namespace Yavsc.Server.Hubs
|
|||
// TODO get and require some admin status for current user on this channel
|
||||
newRoom.Topic = channelInfo.Topic;
|
||||
}
|
||||
newRoom.LatestJoinPart = DateTime.Now;
|
||||
newRoom.LatestJoinPart = DateTime.UtcNow;
|
||||
|
||||
_dbContext.ChatRoom.Add(newRoom);
|
||||
_dbContext.SaveChanges(user.Id);
|
||||
|
|
|
|||
|
|
@ -299,7 +299,7 @@ namespace Yavsc.Models
|
|||
public DbSet<MusicLoverSettings> MusicLoverSettings { get; set; }
|
||||
public DbSet<CoWorking> CoWorking { get; set; }
|
||||
|
||||
private void AddTimestamps(string userId)
|
||||
private void AddTimestamps(string userId)
|
||||
{ var entities =
|
||||
ChangeTracker.Entries()
|
||||
.Where(x => x.Entity.GetType().GetInterface(nameof(ITrackedEntity)) != null
|
||||
|
|
@ -310,11 +310,11 @@ namespace Yavsc.Models
|
|||
{
|
||||
if (entity.State == EntityState.Added)
|
||||
{
|
||||
((ITrackedEntity)entity.Entity).DateCreated = DateTime.Now;
|
||||
((ITrackedEntity)entity.Entity).DateCreated = DateTime.UtcNow;
|
||||
((ITrackedEntity)entity.Entity).UserCreated = userId;
|
||||
}
|
||||
|
||||
((ITrackedEntity)entity.Entity).DateModified = DateTime.Now;
|
||||
((ITrackedEntity)entity.Entity).DateModified = DateTime.UtcNow;
|
||||
((ITrackedEntity)entity.Entity).UserModified = userId;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue