-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exposing internal virtuals involving searching a key in DataView #27137
Comments
I added the eric comment in the description |
Please link to the comment directly. |
I take it that this is just a precursor to exposing these in netstandard? Technically you could do it without new public api if you push the types down on netcoreapp. |
i didnt understand that. can you please explain a little bit more ?
yep |
Imagine the implementation of DataTableExtensions (and its closure) was typeforwarded to the same assembly as DataView. It wouldn’t need those virtuals to be public since it could override them from the same assembly. Granted you still wouldn’t be able to do this in a netstandard implementation, only for netcoreapp. That’s the same as this in a way, since you can only add this API to netcoreapp. I bet pushing the types down is a much larger change than this but it’s possible if you really don’t want to make that API public. |
Thanks for the info. |
I think making public (actually protected unless there's a good reason for public) is better since it preserves the type factoring/architecture. I think you'll need to examine if making that change is the correct thing for the API and doesn't cause any harm or confusion for its existing use cases. Typically we try to go over that sort of thing in the API review process. If it passes that test then we go with it. If not then you fall-back to the moving-types approach. |
@Anipik can these be protected rather than public? @keeratsingh do you have any concerns about exposing these? It does seem less ugly and more correct than internalsvisibleto, but it's not our type. |
we can make both the properties and ctor protected. There shouldnt be any issue with that. i will test the changes in the local branch and let you know, if i face any other problems. |
@danmosemsft I believe @divega would be the better person to answer this question since he has more API related insight than I do. |
@danmosemsft we can make everything protected except I updated the proposal. I will start adding the LinqDataView to check if we require anything else |
I suggest renaming |
@danmosemsft I have updated the issue with all the classes and methods. I also linked to the implementation branch. |
I think this is going to be too much new API to expose just for this purpose. What I suggest is
This implies that it will probably become part of .NET Standard in due course, which seems fine. @weshaggard does this seem right. |
@danmosemsft that sounds reasonable and should work if we feel this one method is worth the hassle. |
@danmosemsft did you mean that we expose |
@Anipik yes. Note that if the compiler is presented with two methods with the same name and parameters, one of them an extension method to type X and the other one an regular method on type X, it will pick the regular method without complaining. So it is OK to have it in both places. The one on S.D.DSE should call directly to the one in S.D.C. Also as mentioned, you will need to add a netcoreapp configuration to the src of S.D.DSE and only expose the method there. |
I would put tests in the test library for S.D.C plus just have a single test on S.D.DSE to check that it calls through to the implementation in S.D.C. |
@weshaggard @danmosemsft @ericstj |
There are 2 options left here
LMK in which direction should i proceed |
@Anipik do you have any any sense of what all would need to be pulled into S.D.C in both of those options? Would it be all of S.D.DSE? If so do we know how much of a binary size increase that causes? If both options end up with close to the same moved into S.D.C then I would go with option 2 so we remain essentially the same from the public surface area standpoint and we don't need to add any new instance members on DataTable. |
I will try it and let you know how much stuff we need to pull into S.D.C |
@weshaggard we need to move for exposing both the overloads of AsDataView function. is that fine to proceed with ? |
Does it add any more dependencies? If not I suspect it is probably fine to proceed with moving them. |
No It didn't require to add any more dependencies |
To add a little more detail the approach of moving those types into System.Data.Common would only work for .NET Core and would still block us from supporting them in .NET Standard. We would end up having to duplicate those types in both libraries and condition them appropriately for the different configurations. So the value add verse the complexity doesn't seem to be worth the cost of adding these at this point. We can consider adding them in some way to .NET Core only in the future if there is enough need. |
Rationale
Winforms require DataTable.AsDataView extension methods. They uses
LinqViewData
datatype which override some internal virtuals likeSo we need to expose these apis and constructor.
Api Proposal
ctor
Methods
Behavior
https://referencesource.microsoft.com/#System.Data.DataSetExtensions/System/Data/LinqDataView.cs,18
implementation
https://github.com/Anipik/corefx/tree/debugAssert
Related Issue:- https://github.com/dotnet/corefx/issues/27610
cc @danmosemsft @ericstj @JeremyKuhne @divega @keeratsingh
Note Explaining Why
https://github.com/dotnet/corefx/issues/27610#issuecomment-410090277
The text was updated successfully, but these errors were encountered: