Omid.N
Omid.N
CC#
Created by Omid.N on 3/5/2024 in #help
✅ EF does not put datetimes properly to the datebase
thanks
38 replies
CC#
Created by Omid.N on 3/5/2024 in #help
✅ EF does not put datetimes properly to the datebase
Yeah it worked !
38 replies
CC#
Created by Omid.N on 3/5/2024 in #help
✅ EF does not put datetimes properly to the datebase
no i did not see it. let me try it
38 replies
CC#
Created by Omid.N on 3/5/2024 in #help
✅ EF does not put datetimes properly to the datebase
yeah
38 replies
CC#
Created by Omid.N on 3/5/2024 in #help
✅ EF does not put datetimes properly to the datebase
should i do anything so that it converts datetime to database type?
38 replies
CC#
Created by Omid.N on 3/5/2024 in #help
✅ EF does not put datetimes properly to the datebase
this is the command that is executed for inserting
38 replies
CC#
Created by Omid.N on 3/5/2024 in #help
✅ EF does not put datetimes properly to the datebase
Executed DbCommand (31ms) [Parameters=[@p0='?', @p1='?' (DbType = DateTime), @p2='?' (DbType = Int32), @p3='?', @p4='?' (DbType = DateTime), @p5='?', @p6='?' (DbType = Int32)], CommandType='Text', Co
mmandTimeout='30']
INSERT INTO "Notes" ("Content", "CreatedAt", "NoteType", "Title", "UpdatedAt", "UserId", "ViewCount")
VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6)
RETURNING "ID";
Executed DbCommand (31ms) [Parameters=[@p0='?', @p1='?' (DbType = DateTime), @p2='?' (DbType = Int32), @p3='?', @p4='?' (DbType = DateTime), @p5='?', @p6='?' (DbType = Int32)], CommandType='Text', Co
mmandTimeout='30']
INSERT INTO "Notes" ("Content", "CreatedAt", "NoteType", "Title", "UpdatedAt", "UserId", "ViewCount")
VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6)
RETURNING "ID";
38 replies
CC#
Created by Omid.N on 3/5/2024 in #help
✅ EF does not put datetimes properly to the datebase
okay
38 replies
CC#
Created by Omid.N on 3/5/2024 in #help
✅ EF does not put datetimes properly to the datebase
i only use the code above
38 replies
CC#
Created by Omid.N on 3/5/2024 in #help
✅ EF does not put datetimes properly to the datebase
also why should i not use AddAsync
38 replies
CC#
Created by Omid.N on 3/5/2024 in #help
✅ EF does not put datetimes properly to the datebase
i think i use codefirst
38 replies
CC#
Created by Omid.N on 3/5/2024 in #help
✅ EF does not put datetimes properly to the datebase
what does it mean?
38 replies
CC#
Created by Omid.N on 3/5/2024 in #help
✅ EF does not put datetimes properly to the datebase
c#
public class Note
{
public int ID { get; set; }
public string Title { get; set; }
public string Content { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }

public NoteType NoteType { get; set; }

[Omitted]
public User? User { get; set; }
public string? UserId { get; set; }
public List<Tag>? Tags { get; set; }

// shows how many times the note has been viewed
public int? ViewCount { get; set; }
}
c#
public class Note
{
public int ID { get; set; }
public string Title { get; set; }
public string Content { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }

public NoteType NoteType { get; set; }

[Omitted]
public User? User { get; set; }
public string? UserId { get; set; }
public List<Tag>? Tags { get; set; }

// shows how many times the note has been viewed
public int? ViewCount { get; set; }
}
38 replies
CC#
Created by Omid.N on 3/5/2024 in #help
✅ EF does not put datetimes properly to the datebase
Cannot write DateTime with Kind=Local to PostgreSQL type 'timestamp with time zone', only UTC is supported.
38 replies
CC#
Created by Omid.N on 3/5/2024 in #help
✅ EF does not put datetimes properly to the datebase
using DateTime.Now gives error
38 replies