c# - OOP interaction with database -
if object oriented programming focused on objects, consist of methods , data, best oop-focused approach working databases, using c#? for example, want log using c# classes, , record logs in sql table. other factors being neutral, more "proper," object-oriented speaking, do: create class what's being logged, , include methods database access (the methods tied closely data) public class activity { public string activityproperty { get; set; } public void sqlmethod1() {} public void sqlmethod2() {} } ...or, create class what's being logged, , create class database access (methods not closely tied data, way data accessed treated object, i.e. referencing ef or orm) public class activity { public string activityproperty { get; set; } } public class sqlmethods { public string sqlproperty { get; set; } public void sqlmethod1(activity activityparam) { } public void sqlmethod2(activity activityparam) { } } ...or, perhaps ...