c# – Data Repository and Complex Queries (DTO)

Following the classic 3 layer architecture

  • domain Model (a list of entities live there and has no dependencies)

  • DAL layer – My Repositories lives there with DBContext implementation (Ado.net) Dal return pure entities ( reference domain model)

  • Service Layer ( Business Layer ) expose methods of repositories ( reference DAL Layer and Domain Model)

  • UI Layer(WPF) > Service Layer(BLL) > Repositories

MY question is related to the following concepts

Reading article upon article, state that Data Repositories should return only entities.

e.g

public interface ICustomerRepository 
{

    IEnumerable<Customer> FindByText(string TextToFind);
    Customer GetByID(string ID);
    IEnumerable<Customer> GetAll();
    void Update(Customer CustomerToAdd);
    void Delete(params string() Ids);
}

Then I ask my self.

  • What if i need to show a list of customer with some other complex inner join, union query.
  • end a lot of more other queries related to other view requirements.

(actually in our accounting application 90% of the screens are never shown data in their pure form(entities). always they are in form with other inner joins , sum amounts etc..
e.g customer : Name,AccountName(inner join from accounts), Balance (inner join from ledger), etc..

Some state that is ok to put this query in repository others say is not good because is not an entity

Where this logic goes? since repositories dose not allow me to return other than entity model.
and also CustomerService in BLL Layer ( dose not allow me to return DTO in methods)

I read that CQRS comes to the stage to solve UI Queries

Ok, lets say that i follow cqrs for query side ( lets skip command as commands and updates go through repository)

Now I end up having:

  • CustomerRepository (DAL Layer)
  • CustomerService (BLL – service layer) which is just exposed repository methods and maybe some other related things
  • CustomerQueries class (BLL – service layer) which contain any complex
    query (DTO) related to customer and has direct connection to sql converting datatable to relative dto and give it to UI layer

My question is this proper way to follow?

which layer CQRS live? in (business layer which some call it service layer?) or in DAL Layer where my repositories live

Many times i found my self much easy way just to type CustomerServices. and the intellisense giving me all the related information I might want from customer, some functions return dto others return some amounts other times just some bool to check some rules which require complex sql queries)

The problem is that, since CustomerService as they say, should only be responsible to call relative CustomerRepository fetch or update only things related to repository,

where i put logic for complex queries and in which layer?

complex analysis – Is there such a holomorphic function?

I have a problem with a certain issu. How to check if there is a holomorphic, such that :

  1. $f(frac{1}{n})=frac{1}{sqrt{n}}$ on $Delta(0,1)$

  2. $f(frac{3n}{3n+1})=0 $ on $Delta(0,2)$

Regarding the first example I thought to consider a function $f(x)=sqrt{x} text{where} x=frac{1}{n}$. From continuity we have $f(0)=0$. Is the theorem of identify shows that such function exists?

complex analysis – Can’t find the integration of $sin ax / (x^2+b^2)^2$

I’ve been trying to find the value of the following integral using the residue theorem :
$$int_0^infty frac{sin ax dx}{(x^2+b^2)^2}$$

So basically the idea that I had is to transform this integral and to make it in the numerator as
$e^{iaz} = cos az + isin az $ and thus
$$mathrm{Im}, int_0^infty frac{e^{iaz}dz}{(z^2+b^2)^2},
= int_0^infty frac{sin az dx}{(z^2+b^2)^2}$$

However in class we’ve only established the residue formula from $-infty$ to $+infty$ , and when I try to integrate it that way (as in from $-infty$ to $+infty$) I obtain $0$ obviously because the function is odd.

Any help is welcome to direct me in the right decision. Also apologies since english isn’t my first language!

calculus – Tricky complex definite integral

I have a complex integral $I$ to solve to show that

$I=int_{-infty}^{infty}frac{x^3sin{x}dx}{x^4+5x^2+4} = frac{(4-e)pi}{3e^2}$

I know that you can integrate over the contour of a semicircle where and represent sin as an infinite sum but not sure what to do next. Should the polynomial be converted to a partial fraction too?

Display and editing complex data

I am looking for suggestion how to display complex data for reading/editing.

Data will be key-value, example:

string-val: “v12”,
int-value: 99,
boolean: true

I these types I think simple table will do the trick (with editable rows).

I will also have to support the following:
array-val: (1, 2 ,3), object-value: {name: “bp”, amount: 4}, array-object-value: ({name: “bp”, amount: 4}, {name: “bp”, amount: 4})

I am considering using: https://material-ui.com/components/tables/#collapsible-table (just an example because we use material-ui), where the dropdown V will have an embedded table.

I am open for any suggestion, this is the only solution I can think of.

linear algebra – Showing the orthogonal subspace to the Range of A is the null space of the complex conjugate of A

I have matrices $A in mathbb{C}^{m times n}$

My goal is to show that $R^{perp}(A) = N(A’)$.

Conceptually I get that the orthogonal space to the range of the matrix is going to be the null space because otherwise it’d be in the row space but I’m having a hard time expressing it in math.

I haven’t done too much complex matrix work so I’m not sure what pitfalls I need to be wary of

Double integral with complex functions

Suppose $f(z_1,z_2)$ is locally integrable on $mathbb{C}^2$. Is it true that
$$frac{1}{2pi}int_0^{2pi}left(frac{1}{2pi}int_0^{2pi}f(e^{itheta}, e^{it})dthetaright)dtleq frac{1}{2pi}int_0^{2pi}f(e^{itheta}, e^{itheta})dtheta?$$

complex analysis – Mandelbrot set and logistic map connection

I’m currently writing an undergraduate thesis on chaos theory with a particular focus on the connection between the Mandelbrot set and the logistic map. I have found scattered posts on this site, Reddit and other such web pages that more or less intuitively explain the connections with bifurcation diagrams and the Mandelbrot set being the parameter space for the logistic map, all of which I understand. However I am having difficulty finding reputable academic sources that research and explain these concepts in a formal mathematical style. I would be very grateful to anybody who could point me in the direction of academic papers or textbooks that cover this. Thank you all!

How to prove complex trigonometric identities?

How can i prove the complex trigonometric identity that says :-
sin(-z)= -sin z

sharepoint online – Reading and updating complex JSON Object in power automate

We have a requirement to update the content in the JSON Stored as multiline text column in one of the list, when one of the item in the another list is updated we need to update the JSON data stored in the item of the source list.

here is the sample json

    [
{
ClientStoryId:
ClientStoryName:
AssetID:
AssetName:
UserName:
UserEmail:
UserID:
}
{
ClientStoryId:
ClientStoryName:
AssetID:
AssetName:
UserName:
UserEmail:
UserID:
}
{
ClientStoryId:
ClientStoryName:
AssetID:
AssetName:
UserName:
UserEmail:
UserID:
}
]

When a user gets added to the Users List with client story and assetName we need to appropriately update the userdetails in the JSON which will be stored as multiline of text in another list.

Kindly help me.